# Contributor: Sean McAvoy <seanmcavoy@gmail.com>
# Maintainer: Sean McAvoy <seanmcavoy@gmail.com>
pkgname=mbpfan
pkgver=2.4.0
pkgrel=0
pkgdesc="simple daemon to control fan speed on MacBooks, other macs"
url="https://ineed.coffee/projects/mbpfan"
arch="x86_64 x86"
license="GPL3.0-or-later"
options="!check"
subpackages="$pkgname-doc $pkgname-openrc"
source="mbpfan-$pkgver.tar.gz::https://github.com/linux-on-mac/mbpfan/archive/refs/tags/v$pkgver.tar.gz
		01-remove-systemd.patch
		$pkgname.initd"

build() {
	make
}

package() {
	DESTDIR="$pkgdir" make install
	install -Dm755 "$srcdir"/"$pkgname".initd "$pkgdir"/etc/init.d/mbpfan
}

sha512sums="
fa906043552a895d274642dfe8e3a94fdece0bf9b430710d9ee4dc4f33b6762fbed3314e4a67ede11916514297d511031cc99b35b7a267b58aceefd73e4b1d22  mbpfan-2.4.0.tar.gz
bd9e2496049978f4dae322279573e784b7866bbdaa39de65b124f5206ab270ff71933b762a1caf3a792b33760bdd66852c46486b66429d825c623a32c8c7c52b  01-remove-systemd.patch
bc3905e85d89e71d56239549bede3dd826633da2152d2e548fdf0c5eb2fde7a94e776afcce4d1657d2198998538d9e19b2a9d464c95c2b14083d8f5782417467  mbpfan.initd
"
